import requests
from bdtime import tt
# from drafts.ip_scan import get_host_ip
# get_host_ip()



try:
    response_0 = requests.get("http://192.168.0.104:5000", timeout=1)
    assert response_0.status_code == 200, '状态码不等于200!'
except Exception as e:
    msg = f'*** 耗时{tt.now(5)}, 请求错误, error: {e}'
    raise ConnectionRefusedError(msg)

content = response_0.content.decode('utf-8')

print(f'--- {tt.get_current_beijing_time_str(decimal_places=1)} 返回数据: {content}')